Skip to content

fix(tui): show cleanup approval wait instead of running Bash - #545

Open
testikun wants to merge 2 commits into
openpi-dev:mainfrom
testikun:codex/issue-544-confirmation-status
Open

testikun wants to merge 2 commits into
openpi-dev:mainfrom
testikun:codex/issue-544-confirmation-status

Conversation

@testikun

Copy link
Copy Markdown
Collaborator

Problem

Fixes #544. Pi emits tool_execution_start before OpenPI’s tool_call cleanup guard finishes. While a guarded rm is awaiting confirmation, the compact Bash row incorrectly says Running rm keep.txt and advances a timer, although the command has not executed.

Value

Users can distinguish a pending decision from active Bash execution. The waiting row does not keep animating or repainted every second while a person decides.

Approach

The cleanup guard publishes the confirmation phase on Pi’s extension EventBus with Session and tool-call identity. The TUI-only file-mutation display projects it as Awaiting approval, clears its execution timer during the wait, and resumes Running after approval. Refusal/cancellation remains awaiting until the blocked result is shown. The guard decision, confirmation choices/default, actual tool definition and execution semantics are unchanged.

The source-scoped investigation is recorded in docs/research/ISSUE_544_CLEANUP_CONFIRMATION_UI_2026-09-17.md.

Validation

  • bun run check: passed (using Bun 1.3.14 via npm exec in this shell).
  • bun run test: 1661 passed, 1 skipped, 0 failed; Vitest 220 passed.
  • Focused guard, renderer, and cross-extension EventBus tests: 22 passed.
  • Pi 0.85.1 interactive TUI/PTY with a single local OpenPI source at f6b49ae: holding confirmation for >3 seconds showed one Awaiting approval row and no Running rm keep.txt row during the wait. Esc preserved the pre-existing file; approval resumed running and deleted it.
  • Ablation: removing the event-driven invalidation brought repeated Running rows back, so it remains necessary.

Impact

  • User-visible: the collapsed Bash tool row distinguishes the confirmation phase and no longer shows a running timer during it.
  • Model-visible context/tools: none. Tool schema, prompt metadata, execution and result are preserved.
  • Runtime/lifecycle: one ephemeral, Session-scoped Pi EventBus phase signal and per-call renderer invalidation; no persistence or permission changes.
  • Persisted config/data: none. Compatibility risk is limited to Pi TUI projection; headless Sessions keep native tool definitions. The separately reported white read/grep flashing is not reproduced on current main and is not addressed by this PR.

@github-actions github-actions Bot added documentation Improvements or additions to documentation area:ui Terminal UI, rendering, themes, or visual assets labels Sep 17, 2026

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查提交:e548f97d90aa52840d74f90b414a7e215dc7b6b6。

本轮未发现新的阻断问题。以下结论仅覆盖所列验证范围,不是合并批准。

验证范围

Full production, test and research-record diff inspected. Frozen head 36 file-mutation-display and workspace-cleanup-guard tests passed, including real ToolExecutionComponent event invalidation and session isolation.

限制与后续

No independent PTY smoke in this audit. Author documents controlled macOS TUI approval/refusal evidence with provenance; does not claim Linux visual reproduction. Approval enforcement unchanged; only operator-facing confirmation phase is projected.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui Terminal UI, rendering, themes, or visual assets documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI: show awaiting confirmation instead of Running before guarded rm

2 participants